
#HOME = /home/jakob

FC = gfortran

FCFLAGS = -g
#FCFLAGS = -O2

LDFLAGS =  -L$(HOME)/lib/ -lfftpack5

PROGRAMS = dataminer

all: $(PROGRAMS)

dataminer: ast.o inout.o init.o erosion.o transport.o deposition.o avalanche_modules.o definitions.o functions.o sources.o

ast.o: inout.o init.o erosion.o transport.o deposition.o avalanche_modules.o definitions.o functions.o sources.o

dataminer.o: ast.o definitions.o init.o inout.o functions.o

transport.o: definitions.o erosion.o deposition.o avalanche_modules.o functions.o

init.o: definitions.o inout.o

erosion.o: definitions.o functions.o

deposition.o: definitions.o functions.o

inout.o: definitions.o functions.o erosion.o deposition.o transport.o

functions.o: definitions.o

sources.o: definitions.o transport.o deposition.o

definitions.o: 


%: %.o
	$(FC) $(FCFLAGS)  -o $@ $^ $(LDFLAGS)

%.o: %.f90
	$(FC) $(FCFLAGS) -c $<

clean:
	rm -f *.o *.mod *.MOD

veryclean: clean
	rm -f *~ $(PROGRAMS)
